def count_file_stats(filename):  
    try:  
        with open(filename, 'r', encoding='utf-8') as file:  
            content = file.read()  
            lines = content.split('\n')  
            words = content.split()  
            return {  
                "lines": len(lines),  
                "words": len(words),  
                "characters": len(content)  
            }  
    except FileNotFoundError:  
        return "文件未找到！"  

if __name__ == "__main__":  
    filename = input("请输入文件名：")  
    stats = count_file_stats(filename)  
    if isinstance(stats, dict):  
        print(f"行数: {stats['lines']}")  
        print(f"单词数: {stats['words']}")  
        print(f"字符数: {stats['characters']}")  
    else:  
        print(stats)  